local xunjie = fk.CreateSkill({
  name = "cc__xunjie",
  tags = {Skill.Compulsory},
})

xunjie:addEffect("filter", {
  card_filter = function(self, card, player)
    return player:getMark("@@cc__xunjie-turn") == 0 and table.contains(player.player_cards[Player.Hand], card.id)
    and player:hasSkill(xunjie.name)
  end,
  view_as = function(self, player, card)
    local c = Fk:cloneCard("nullification", card.suit, card.number)
    c.skillName = "cc__xunjie"
    return c
  end,
})

xunjie:addEffect(fk.CardUseFinished, {
  anim_type = "negative",
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return data.from == player and player:hasSkill(xunjie.name) and player:getMark("@@rcc__xunjie-turn") == 0
  end,
  on_use = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "@@cc__xunjie-turn")
  end,
})


Fk:loadTranslationTable {
["cc__xunjie"] = "殉节",
[":cc__xunjie"] = "<b>锁定技</b>，你的手牌均视为【无懈可击】，直至你本回合首次使用牌结算后。",
["$cc__xunjie1"] = "",
["$cc__xunjie2"] = "",
["@@cc__xunjie-turn"] = "殉节"
}

return xunjie